home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / unixSyscall / RCS / killpg.c,v < prev    next >
Encoding:
Text File  |  1988-06-19  |  1.5 KB  |  86 lines

  1. head     1.1;
  2. access   ;
  3. symbols  ;
  4. locks    ; strict;
  5. comment  @ * @;
  6.  
  7.  
  8. 1.1
  9. date     88.06.19.14.31.35;  author ouster;  state Exp;
  10. branches ;
  11. next     ;
  12.  
  13.  
  14. desc
  15. @@
  16.  
  17.  
  18.  
  19. 1.1
  20. log
  21. @Initial revision
  22. @
  23. text
  24. @/* 
  25.  * killpg.c --
  26.  *
  27.  *    Procedure to map from Unix kill system call to Sprite Sig_Send call.
  28.  *    Note: many Unix signals are not supported under Sprite.
  29.  *
  30.  * Copyright 1986 Regents of the University of California
  31.  * All rights reserved.
  32.  */
  33.  
  34. #ifndef lint
  35. static char rcsid[] = "$Header: killpg.c,v 1.2 88/03/22 19:42:18 deboor Exp $ SPRITE (Berkeley)";
  36. #endif not lint
  37.  
  38. #include "sprite.h"
  39. #include "sig.h"
  40.  
  41. #include "compatInt.h"
  42. #include <signal.h>
  43. #include <errno.h>
  44.  
  45.  
  46. /*
  47.  *----------------------------------------------------------------------
  48.  *
  49.  * killpg --
  50.  *
  51.  *    Procedure to map from Unix killpg system call to Sprite 
  52.  *    Sig_Send.
  53.  *
  54.  * Results:
  55.  *    UNIX_ERROR is returned upon error, with the actual error code
  56.  *    stored in errno.
  57.  *
  58.  * Side effects:
  59.  *    None.
  60.  *
  61.  *----------------------------------------------------------------------
  62.  */
  63.  
  64. int
  65. killpg(pgrp, sig)
  66.     int pgrp;
  67.     int sig;
  68. {
  69.     ReturnStatus status;
  70.     int         spriteSignal;
  71.  
  72.     status = Compat_UnixSignalToSprite(sig, &spriteSignal);
  73.     if (status == FAILURE || (spriteSignal == NULL && sig != 0)) {
  74.     errno = EINVAL;
  75.     return(UNIX_ERROR);
  76.     }
  77.     status = Sig_Send(spriteSignal, pgrp, TRUE);
  78.     if (status != SUCCESS) {
  79.     errno = Compat_MapCode(status);
  80.     return(UNIX_ERROR);    
  81.     } else {
  82.     return(UNIX_SUCCESS);
  83.     }
  84. }
  85. @
  86.